package com.cxc.java8;

import java.util.Arrays;
import java.util.stream.Stream;

public class StreamMatch {

    public static void main(String[] args) {

        Stream<Integer> stream = Arrays.stream(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8});
        boolean result = stream.allMatch(i -> i > 10);
        System.out.println(result);

        stream = Arrays.stream(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8});
        boolean result2 = stream.anyMatch(i -> i > 6);
        System.out.println(result2);
        stream = Arrays.stream(new Integer[]{1, 2, 3, 4, 5, 6, 7, 8});
        boolean result3 = stream.noneMatch(i->i<3);
        System.out.println(result3);


    }

}
